package com.dhcc.DRGsHosp.core.domain;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.openkoala.koala.commons.domain.KoalaLegacyEntity;

/**
 * @title :QuotaManage.java
 * @description :标杆管理
 * @author :liqingyang
 * @date :2015年4月2日
 * @version :1.0
 * @copyright :DHCC 2013-2014
 */
@Entity
@Table(name = "T_QUOTAMANAGE", schema = "DRGs")
public class QuotaManage extends KoalaLegacyEntity {

	private static final long serialVersionUID = -2700241427681303048L;

	// 标杆ID
	
	@Id
	@Column(name = "QM_ID", nullable = false)
	private String qmId;

	// Par指标项代码
	@Column(name = "PARQUOTA_CODE", nullable = false)
	private String parquotaCode;

	// Par科室代码
	@Column(name = "PARDEP_CODE")
	private String parDepCode;

	// ParDRG代码
	@Column(name = "PARDRG_CODE")
	private String pardrgCode;

	// 标杆值
	@Column(name = "MANAGE_BENCHMARK")
	private Double manageBenchmark;

	// 科室组代码
	@Column(name = "PARDEPGROUP_CODE")
	private String parDepGroupCode;

	// 病人类型
	@Column(name = "PATIENT_TYPE")
	private String parPatientType;
	
	// 主键关联代码
	@Column(name = "PAR_MS_CODE")
	private String parMsCode;
	
	// 管理年份
	@Column(name = "MANAGE_YEAR")
	private String manageYear;
	
	
	/**
	 * 
	 */
	public QuotaManage() {
		super();
	}

	/**
	 * @param parquotaCode
	 * @param manageBenchmark
	 */
	public QuotaManage(String parquotaCode, Double manageBenchmark) {
		super();
		this.parquotaCode = parquotaCode;
		this.manageBenchmark = manageBenchmark;
	}

	
	/**
	 * 
     * @param qmId
     * @param parquotaCode
     * @param parDepCode
     * @param pardrgCode
     * @param manageBenchmark
     * @param parDepGroupCode
     * @param parPatientType
     * @param parMsCode
     * @param manageYear
     * @param parWardCode
     * @param parDoctorCode
	 */
	public QuotaManage(String qmId, String parquotaCode, String parDepCode, String pardrgCode, Double manageBenchmark,
			String parDepGroupCode, String parPatientType, String parMsCode, String manageYear ) {
		super();
		this.qmId = qmId;
		this.parquotaCode = parquotaCode;
		this.parDepCode = parDepCode;
		this.pardrgCode = pardrgCode;
		this.manageBenchmark = manageBenchmark;
		this.parDepGroupCode = parDepGroupCode;
		this.parPatientType = parPatientType;
		this.parMsCode = parMsCode;
		this.manageYear = manageYear;
	}
	
	public QuotaManage(String qmId, String parquotaCode, String parDepCode, String pardrgCode, String parDepGroupCode,
			String parPatientType, String parMsCode, String manageYear) {
		super();
		this.qmId = qmId;
		this.parquotaCode = parquotaCode;
		this.parDepCode = parDepCode;
		this.pardrgCode = pardrgCode;
		this.parDepGroupCode = parDepGroupCode;
		this.parPatientType = parPatientType;
		this.parMsCode = parMsCode;
		this.manageYear = manageYear;
	}

	public String getQmId() {
		return qmId;
	}

	public void setQmId(String qmId) {
		this.qmId = qmId;
	}

	public String getParquotaCode() {
		return parquotaCode;
	}

	public void setParquotaCode(String parquotaCode) {
		this.parquotaCode = parquotaCode;
	}

	public String getParDepCode() {
		return parDepCode;
	}

	public void setParDepCode(String parDepCode) {
		this.parDepCode = parDepCode;
	}

	public String getPardrgCode() {
		return pardrgCode;
	}

	public void setPardrgCode(String pardrgCode) {
		this.pardrgCode = pardrgCode;
	}

	public Double getManageBenchmark() {
		return manageBenchmark;
	}

	public void setManageBenchmark(Double manageBenchmark) {
		this.manageBenchmark = manageBenchmark;
	}

	public String getParDepGroupCode() {
		return parDepGroupCode;
	}

	public void setParDepGroupCode(String parDepGroupCode) {
		this.parDepGroupCode = parDepGroupCode;
	}

	public String getParPatientType() {
		return parPatientType;
	}

	public void setParPatientType(String parPatientType) {
		this.parPatientType = parPatientType;
	}

	public String getParMsCode() {
		return parMsCode;
	}

	public void setParMsCode(String parMsCode) {
		this.parMsCode = parMsCode;
	}

	public String getManageYear() {
		return manageYear;
	}

	public void setManageYear(String manageYear) {
		this.manageYear = manageYear;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.dayatang.domain.Entity#getId()
	 */
	@Override
	public Serializable getId() {
		// TODO Auto-generated method stub
		return qmId;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.openkoala.koala.commons.domain.KoalaBaseEntity#businessKeys()
	 */
	@Override
	public String[] businessKeys() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1 ;
		result = prime * result + ((manageYear == null) ? 0 : manageYear.hashCode());
		result = prime * result + ((parDepCode == null) ? 0 : parDepCode.hashCode());
		result = prime * result + ((parDepGroupCode == null) ? 0 : parDepGroupCode.hashCode());
		result = prime * result + ((parMsCode == null) ? 0 : parMsCode.hashCode());
		result = prime * result + ((parPatientType == null) ? 0 : parPatientType.hashCode());
		result = prime * result + ((pardrgCode == null) ? 0 : pardrgCode.hashCode());
		result = prime * result + ((parquotaCode == null) ? 0 : parquotaCode.hashCode());
		return 1;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (getClass() != obj.getClass())
			return false;
		QuotaManage other = (QuotaManage) obj;
		if (manageYear == null) {
			if (other.manageYear != null )
				return false;
		} else if (!manageYear.equals(other.manageYear))
			return false;
		if (parDepCode == null) {
			if (other.parDepCode != null)
				return false;
		} else if (!parDepCode.equals(other.parDepCode))
			return false;
		if (parDepGroupCode == null) {
			if (other.parDepGroupCode != null )
				return false;
		} else if (!parDepGroupCode.equals(other.parDepGroupCode))
			return false;
		if (parMsCode == null) {
			if (other.parMsCode != null )
				return false;
		} else if (!parMsCode.equals(other.parMsCode))
			return false;
		if (parPatientType == null) {
			if (other.parPatientType != null)
				return false;
		} else if (!parPatientType.equals(other.parPatientType))
			return false;
		if (pardrgCode == null) {
			if (other.pardrgCode != null )
				return false;
		} else if (!pardrgCode.equals(other.pardrgCode))
			return false;
		if (parquotaCode == null) {
			if (other.parquotaCode != null )
				return false;
		} else if (!parquotaCode.equals(other.parquotaCode))
			return false;
		return true;
	}
	
}
